
//////////////////////////////////////////////////////////////
//////// My Keywords from the Excel                   ////
////////////////////////////////////////////////////////////


package AdminTab;
import org.openqa.selenium.WebDriver;


public class KWexecutor {
	static String vKW, vIP1, vIP2;
	public static String vBrowser;
	static WebDriver myD;
	
	
	public static String call_KW() throws Exception {
		
		String vVerifyError;
		vVerifyError = "NA";
		//Call the corresponding Keyword function
		if (vKW.equalsIgnoreCase("enterText")) {
			KW.enterText(vIP1, vIP2);
		}
		if (vKW.equalsIgnoreCase("openBrowser")){
			KW.openBrowser(vIP1);
		}
		if (vKW.equalsIgnoreCase("quitBrowser")){
			KW.quitBrowser();
		}
		if (vKW.equalsIgnoreCase("closeBrowser")){
			KW.closeBrowser();
		}
		
		if (vKW.equalsIgnoreCase("navigateBrowser")){
			KW.navigateBrowser(vIP1);
		}
		if(vKW.equalsIgnoreCase("clickElement")){
			KW.clickElement(vIP1);
		}
		if (vKW.equalsIgnoreCase("verifyText")){
			vVerifyError = KW.verifyText(vIP1, vIP2);
			System.out.println("Test is a fail" + vVerifyError );
		}
		if (vKW.equalsIgnoreCase("defaultValue")){
			vVerifyError = KW.defaultvaluelist(vIP1, vIP2);
			System.out.println("Test is a Fail" + vVerifyError );
		}
		if (vKW.equalsIgnoreCase("readText")){
			KW.readText(vIP1);					
		}				
		if (vKW.equalsIgnoreCase("selectList")){
			KW.selectList(vIP1, vIP2);
		}
		if (vKW.equalsIgnoreCase("checkBox")){
			KW.checkBox(vIP1);
		}
		if (vKW.equalsIgnoreCase("closeBrowser")){
			KW.closeBrowser();
		}
					
	  if(vKW.equalsIgnoreCase("waitTime")){
			KW.waitTime(2000);
			}
	  if(vKW.equalsIgnoreCase("verifyTitle")){
			vVerifyError = KW.verifyTitle(vIP1);
			System.out.println("Test is a" + vVerifyError );
			}
	  
						
	  /*if (vKW.equals("navigate_to")){
			// Initializing my Browser that we wish to work with
			if (vBrowser.equals("IE")) {
				myD = new InternetExplorerDriver();
			}
			if (vBrowser.equals("FF")) {
				myD = new FirefoxDriver();
			}
			if (vBrowser.equals("HTML")) {
				myD = new HtmlUnitDriver();
			}
			navigate_to(myD, vIP1);
		}
				*/	
		return vVerifyError;
	}

}

